# Maintainer: Daniel M. Capella <polyzen@archlinux.org>
# Contributor: Hugo Osvaldo Barrera <hugo@barrera.io>

_name=docstring-to-markdown
pkgname=python-docstring-to-markdown
pkgver=0.12
pkgrel=2
pkgdesc='On the fly conversion of Python docstrings to markdown'
arch=('any')
url=https://github.com/python-lsp/docstring-to-markdown
license=('LGPL2.1')
depends=('python')
makedepends=('python-build' 'python-installer' 'python-setuptools'
             'python-wheel')
checkdepends=('python-pytest')
source=("https://files.pythonhosted.org/packages/source/${_name::1}/${_name}/${_name}-${pkgver}.tar.gz")
sha256sums=('40004224b412bd6f64c0f3b85bb357a41341afd66c4b4896709efa56827fb2bb')
b2sums=('1cb5a1ab524741ffb31ca7dab350506ed5c04200939ac47f1cd10834a5475ceb1376b2102e45577931ce2b21cd568100562abb0c31aa16ca96417058ec1c6719')

build() {
  cd $_name-$pkgver
  python -m build --wheel --no-isolation
}

check() {
 cd $_name-$pkgver
  python -m venv --system-site-packages test-env
  test-env/bin/python -m installer dist/*.whl
  test-env/bin/python -m pytest -c /dev/null --pyargs tests
}

package() {
  cd $_name-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
}
